import { Column, Entity } from 'typeorm';

import { BaseEntity } from '../../infra/entity/base';

@Entity({ name: 'nest_user' })
export class User extends BaseEntity {
  @Column('varchar', { length: 40, unique: true })
  username: string;

  @Column('varchar', { length: 100 })
  password: string;

  @Column('boolean', { default: true })
  isActive: boolean;

  @Column('boolean', { default: false })
  isAdmin: boolean;

  @Column('varchar', { default: 'admin' }) // 默认角色
  roles: string;
}
